aboutsummaryrefslogtreecommitdiff
path: root/www-2/src/pages/[...id].astro
blob: bbaed88ff003a68285d1eb4ada7281ce6b35c749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---
import { getCollection, render } from "astro:content";

import ArticlePage from "../layouts/ArticlePage.astro";

export async function getStaticPaths() {
    const articles = await getCollection("articles");
    return articles.map((post) => ({
        params: { id: post.id },
        props: { post },
    }));
}

const { post } = Astro.props;
const { Content } = await render(post);
---

<ArticlePage id={post.id} data={post.data}><Content /></ArticlePage>